package com.example.week2.mvp.view;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

import com.example.mylibrary.mvp.view.BaseActivity;
import com.example.week2.R;
import com.example.week2.mvp.contact.Contact;
import com.example.week2.mvp.model.Model;
import com.example.week2.mvp.presenter.Presenter;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class RegisterActivity extends BaseActivity<Presenter> implements Contact.View {
    @BindView(R.id.et1)
    EditText et1;
    @BindView(R.id.et2)
    EditText et2;
    @BindView(R.id.bt)
    Button bt;
    Presenter mPresenter;

    @Override
    public int bindLayout() {
        return R.layout.activity_register;
    }

    @Override
    public void initView() {

    }


    @Override
    public void inJect() {
        mPresenter=new Presenter(new Model(),this);
    }

    @Override
    public void initData() {

    }


    @Override
    public String getusername() {
        return et1.getText().toString().trim();
    }

    @Override
    public String getPwd() {
        return et2.getText().toString().trim();
    }

    @Override
    public void goLogin() {
        Intent intent = new Intent(this,LoginActivity.class);
        intent.putExtra("s1",et1.getText().toString());
        intent.putExtra("s2",et2.getText().toString());
        startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick(R.id.bt)
    public void onViewClicked() {
        mPresenter.register();
    }

    @Override
    public void LoadLayout() {

    }

    @Override
    public void hideLayout() {

    }
}
